#ifndef SERIALPORT_H
#define SERIALPORT_H

#include <QObject>
#include <QSerialPort>
#include <QSerialPortInfo>
#include <QDebug>

class SerialPort : public QObject
{
    Q_OBJECT
public:
    explicit SerialPort(QObject *parent = nullptr);

    void setSerialPort(QSerialPort *serial, const QString &portName);
signals:

public slots:
    void readFromSerial1()
    {
        QByteArray data = serial1->readAll();
        qDebug() << data;
    }
private:
    QSerialPort* serial1;
};

#endif // SERIALPORT_H
